home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
SGI Hot Mix 17
/
Hot Mix 17.iso
/
HM17_SGI
/
research
/
lib
/
svdfunct.pro
< prev
next >
Wrap
Text File
|
1997-07-08
|
538b
|
21 lines
; $Id: svdfunct.pro,v 1.3 1997/01/15 03:11:50 ali Exp $
function svdfunct,X,M
;
; Default function for SVDFIT
;
; Accepts scalar X and M, returns
; the basis functions for a polynomial series.
;
XX=X[0] ; ensure scalar XX
sz=reverse(size(XX)) ; use size to get the type
IF sz[n_elements(sz)-2] EQ 5 THEN $
basis=DBLARR(M) else basis=FLTARR(M)
;
; Calculate and return the basis functions
;
basis[0]=1.0
FOR i=1,M-1 DO basis[i]=basis[i-1]*XX
return,basis
end